// word_encrypt 简单，字符串加密
#include <iostream>
#include <string>
char letterLower[29] = "";
char letterUpper[29] = "";
char digit[13] = {0};

void setupLetter() {
  int i = 0;
  letterLower[i] = 'z';
  for (i = 1; i <= 26; i++) {
    letterLower[i] = i + 'a' - 1;
  }
  letterLower[i] = 'a';
  i = 0;
  letterUpper[i] = 'Z';
  for (i = 1; i <= 26; i++) {
    letterUpper[i] = i + 'A' - 1;
  }
  letterUpper[i] = 'A';
  i = 0;
  digit[i] = '9';
  for (i = 1; i <= 10; i++) {
    digit[i] = i + '0' - 1;
  }
  digit[i] = '0';
  //  printf("%s,\n", letterLower);
  //  printf("%s,\n", letterUpper);
  //  printf("%s,\n", digit);
}

std::string encrypt(const std::string& str) {
  std::string s_encr;
  for (auto c : str) {
    if (islower(c)) {
      int id = c - 'a' + 1 + 1;
      s_encr += toupper(letterLower[id]);
    } else if (isupper(c)) {
      int id = c - 'A' + 1 + 1;
      s_encr += tolower(letterUpper[id]);
    } else if (isdigit(c)) {
      int id = c - '0' + 1 + 1;
      s_encr += digit[id];
    } else {
      s_encr += c;
    }
  }
  return s_encr;
}

//  0 - 1 = 25  id + 25 - 1
//   25 - 1 = 24  id + 25 - 1

std::string decrypt(const std::string& str) {
  std::string s_decr;
  for (auto c : str) {
    if (islower(c)) {
      int id = c - 'a' + 1 - 1;
      s_decr += toupper(letterLower[id]);
    } else if (isupper(c)) {
      int id = c - 'A' + 1 - 1;
      s_decr += tolower(letterUpper[id]);
    } else if (isdigit(c)) {
      int id = c - '0' + 1 - 1;
      s_decr += digit[id];
    } else {
      s_decr += c;
    }
  }
  return s_decr;
}

int main() {
  std::string rawString1 =
      "Zz012OA92AptLq5G1lW8564qC4nKMjv8C";  // will be encrypt
  std::string rawString2 =
      "Zz103pb03bQUmR6h2Mx9675Rd5OlnKW9d";  // will be decrypt
  setupLetter();
  std::cin >> rawString1 >> rawString2;

  printf("%s\n", encrypt(rawString1).c_str());
  printf("%s\n", decrypt(rawString2).c_str());

  return 0;
}
